package com.wuyou.simple;

/**
 * 2027. 转换字符串的最少操作次数
 */
public class MinimumMoves {

    public static void main(String[] args) {
        String s = "XXOX";
        System.out.println(solution_1(s));
    }


    public static int solution_1(String s) {
        char[] chars = s.toCharArray();
        int res = 0;
        for (int i = 0; i < chars.length; i++) {
            if (chars[i] == 'X') {
                i += 2;
                res ++;
            }
        }
        return res;
    }
}
